import BaseRest from './rest';


export default class extends BaseRest {

  indexAction() {
    return this.display()
  }

  async idAction() {
    const NewsService: any = this.service('NewsModel')
    let newsDetail = await NewsService.getNewsDetail(this.get('id'))
    this.assign('newsDetail',newsDetail.data.news)
    this.assign('newsBrowse',newsDetail.data.browseCount)
    this.assign('newsLike',newsDetail.data.likeCount)
    return this.display()
  }
}
